class TourTypesController < ApplicationController
  
  layout 'admin'

  # GET /tour_types
  # GET /tour_types.json
  def index
    @tour_types = TourType.all

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # GET /tour_types/1
  # GET /tour_types/1.json
  def show
    @tour_type = TourType.find(params[:id])

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # GET /tour_types/new
  # GET /tour_types/new.json
  def new
    @tour_type = TourType.new

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # GET /tour_types/1/edit
  def edit
    @tour_type = TourType.find(params[:id])
  end

  # POST /tour_types
  # POST /tour_types.json
  def create
    @tour_type = TourType.new(params[:tour_type])
    @tour_type.save
    
    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # PUT /tour_types/1
  # PUT /tour_types/1.json
  def update
    @tour_type = TourType.find(params[:id])
    @tour_type.update_attributes(params[:tour_type])

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # DELETE /tour_types/1
  # DELETE /tour_types/1.json
  def destroy
    @tour_type = TourType.find(params[:id])
    @tour_type.destroy

    respond_to do |format|
      format.js { render layout: false }
    end
  end
end
